package com.gitee.dolt.core.exception;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author LYH
 */
@Data
@Accessors(chain = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor
public class ValidParamData {
    private String target;
    private String field;
    private Object rejectValue;
    private String msg;

    public static ValidParamData valueOf(String target, String field, Object rejectValue, String msg) {
        return new ValidParamData(target, field, rejectValue, msg);
    }

    public static ValidParamData valueOf(String field, Object rejectValue, String msg) {
        return valueOf(null, field, rejectValue, msg);
    }

    public static ValidParamData valueOf(String field, String msg) {
        return valueOf(field, null, msg);
    }
}